{php include wl_template('common/header');}
<div class="app-content">
	<ul class="nav nav-tabs" id="myTab">
		<li class="active"><a href="#">增加类别</a></li>
	</ul>
	<div class="app-form">
		<form action="" method="post" class="form-horizontal form" id="form">
			<div class="panel panel-default">
				<div class="panel-heading">一卡通类别</div>
				<div class="panel-body">
					<div class="panel-body">
						<div class="form-group">
							<label class="col-sm-2 control-label">类别名称</label>
							<div class="col-sm-9">
								<input type="text" name="data[name]" id="name" class="form-control" value="{$data['name']}" />
							</div>
						</div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">详细信息</label>
                            <div class="col-sm-9">
                                <textarea name="data[detail]" placeholder="请输入该卡的详细信息..." class="form-control" role="1" style="resize:none;" rows="5">{$data['detail']}</textarea>
                            </div>
                        </div>
						{if $halfset['halfcardtype'] == 2}
						<div class="form-group">
							<label class="col-sm-2 control-label">适用代理</label>
							<div class="col-sm-9">
								<select name="data[aid]" class="form-control">
									<option value="0"  {if $data['aid'] == 0}selected="selected"{/if}>通用</option>
									{loop $agents $agent}
									<option value="{$agent['id']}"  {if $data['aid'] == $agent['id'] }selected="selected"{/if}>{$agent['agentname']}</option>
									{/loop}
								</select>
							</div>
						</div>
						{/if}
						<div class="form-group">
							<label class="col-sm-2 control-label">时长</label>
							<div class="col-md-9">
								<div class="input-group">
									<input type="text" name="data[days]" class="form-control" value="{$data['days']}" />
									<span class="input-group-addon">天</span>
								</div>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label" >价格</label>
							<div class="col-md-9">
								<div class="input-group">
									<span class="input-group-addon">现价</span>
									<input type="text" name="data[price]" class="form-control" value="{$data['price']}" />
									<span class="input-group-addon">￥，原价</span>
									<input type="text" name="data[old_price]" class="form-control" value="{$data['old_price']}" />
									<span class="input-group-addon">￥</span>
								</div>
							</div>
						</div>
                        {if file_exists(IA_ROOT . '/addons/'.MODULE_NAME.'/pTLjC21GjCGj.log')}
                            <!--某个用户定制的开通一卡通时赠送金额功能-->
                            <div class="form-group">
                                <label class="col-sm-2 control-label" >赠送金额</label>
                                <div class="col-md-9">
                                    <div class="input-group">
                                        <span class="input-group-addon">￥</span>
                                        <input type="text" name="data[give_price]" class="form-control" value="{$data['give_price']}" />
                                    </div>
                                    <span class="help-block">用户开通当前一卡通所赠送的金额</span>
                                </div>
                            </div>
                        {/if}
						<div class="form-group">
							<label class="col-sm-2 control-label">匹配会员等级</label>
							<div class="col-md-9">
								<select name="data[levelid]" style="width: 100%;">
									<option value="0" {if $data['levelid'] == 0 || empty($data['levelid'])} selected="selected" {/if} >{$delevel['name']}</option>
									{loop $levels $level}
									<option value="{$level['id']}" {if $data['levelid'] == $level['id']} selected="selected" {/if} >{$level['name']}</option>
									{/loop}
								</select>
							</div>
						</div>
						{if $disset['appdis'] == 2 && $disset['switch'] && $disset['together'] == 1}
						<div class="form-group">
							<label class="col-sm-2 control-label">匹配分销等级</label>
							<div class="col-md-9">
								<select name="data[dislevelid]" style="width: 100%;">
									{loop $dislevels $dislevel}
									<option value="{$dislevel['id']}" {if $data['dislevelid'] == $dislevel['id']} selected="selected" {/if} >{$dislevel['name']}</option>
									{/loop}
								</select>
							</div>
						</div>
						{/if}
						<div class="form-group">
							<label class="col-sm-2 control-label" >可开通次数</label>
							<div class="col-md-9">
								<div class="input-group">
									<input type="text" name="data[num]" class="form-control" value="{$data['num']}" />
									<span class="input-group-addon">次</span>
								</div>
								<span class="help-block">不填或则填0表示不限制</span>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 control-label">排序</label>
							<div class="col-md-9">
								<input type="number" min="0" name="data[sort]" class="form-control" value="{$data['sort']}" />
								<span class="help-block">数字越大越靠前</span>
							</div>
						</div>
						{if $_W['wlsetting']['distribution']['switch']}
						<div class="form-group">
							<label class="col-sm-2 control-label">是否参与分销</label>
							<div class="col-xs-12 col-sm-8">
								<div class="radio radio-success radio-inline" onclick="distri(1)">
									<input type="radio" id="inlineRadio5" name="data[isdistri]" value="0" {if intval($data['isdistri']) != 1}checked="checked"{/if} >
									<label for="inlineRadio5"> 参与 </label>
								</div>
								<div class="radio radio-success radio-inline" onclick="distri(2)">
									<input type="radio" id="inlineRadio6" name="data[isdistri]" value="1" {if intval($data['isdistri']) == 1}checked="checked"{/if}>
									<label for="inlineRadio6"> 不参与 </label>
								</div>
							</div>
						</div>
						<div id="distridiv" {if $data['isdistri']} style="display: none;" {/if} >
						<div class="form-group">
							<label class="col-sm-2 control-label" >一级分销结算金额</label>
							<div class="col-md-9">
								<div class="input-group">
									<span class="input-group-addon">￥</span>
									<input type="text" name="data[onedismoney]" class="form-control" value="{$data['onedismoney']}" />
								</div>
							</div>
						</div>
						{if $_W['wlsetting']['distribution']['ranknum'] > 1}
						<div class="form-group">
							<label class="col-sm-2 control-label" >二级分销结算金额</label>
							<div class="col-md-9">
								<div class="input-group">
									<span class="input-group-addon">￥</span>
									<input type="text" name="data[twodismoney]" class="form-control" value="{$data['twodismoney']}" />
								</div>
							</div>
						</div>
						{/if}
						{if $_W['wlsetting']['distribution']['ranknum'] > 2}
						<div class="form-group">
							<label class="col-sm-2 control-label" >三级分销结算金额</label>
							<div class="col-md-9">
								<div class="input-group">
									<span class="input-group-addon">￥</span>
									<input type="text" name="data[threedismoney]" class="form-control" value="{$data['threedismoney']}" />
								</div>
							</div>
						</div>
						{/if}
					</div>
					{/if}
					{if !empty($paidlist)}
					<div class="form-group">
						<label class="col-sm-2 control-label">支付有礼</label>
						<div class="col-sm-9">
							<select name="data[paidid]" class="form-control chosen-select">
								<option value="" {if empty($data['paidid'])}selected="selected"{/if}>请选择支付有礼</option>
								{loop $paidlist $pai2}
								<option value="{$pai2['id']}" {if $data['paidid'] == $pai2['id']}selected="selected"{/if}>{$pai2['title']}</option>
								{/loop}
							</select>
						</div>
					</div>
					{/if}
					<div class="form-group">
						<label class="col-sm-2 control-label">是否可用于续费</label>
						<div class="col-xs-12 col-sm-8">
							<label class="radio radio-success radio-inline">
								<input type="radio" name="data[renew]" value="0" {if intval($data['renew']) == 0}checked="checked"{/if}>是
							</label>
							<label class="radio radio-success radio-inline">
								<input type="radio" name="data[renew]" value="1" {if intval($data['renew']) == 1}checked="checked"{/if}>否
							</label>
							<label class="radio radio-success radio-inline">
								<input type="radio" name="data[renew]" value="2" {if intval($data['renew']) == 2}checked="checked"{/if}>只能用于续费
							</label>
							<span class="help-block">已开通的一卡通会员是否可以使用此类型进行续费延期</span>
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-2 control-label">是否推荐</label>
						<div class="col-xs-12 col-sm-8">
							<div class="radio radio-success radio-inline">
								<input type="radio" id="inlineRadio1" name="data[is_hot]" value="1" {if intval($data['is_hot']) == 1}checked="checked"{/if}>
								<label for="inlineRadio1"> 是 </label>
							</div>
							<div class="radio radio-success radio-inline">
								<input type="radio" id="inlineRadio2" name="data[is_hot]" value="0" {if intval($data['is_hot']) != 1}checked="checked"{/if} >
								<label for="inlineRadio2"> 否 </label>
							</div>
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-2 control-label">是否启用</label>
						<div class="col-xs-12 col-sm-8">
							<div class="radio radio-success radio-inline">
								<input type="radio" id="inlineRadio3" name="data[status]" value="1" {if intval($data['status']) == 1}checked="checked"{/if}>
								<label for="inlineRadio3"> 是 </label>
							</div>
							<div class="radio radio-success radio-inline">
								<input type="radio" id="inlineRadio4" name="data[status]" value="2" {if intval($data['status']) != 1}checked="checked"{/if} >
								<label for="inlineRadio4"> 否 </label>
							</div>
						</div>
					</div>
					{if is_file(PATH_MODULE.'TnSrtWDJ.log')}
					<div class="form-group">
						<label class="col-sm-2 control-label">仅限扫码显示</label>
						<div class="col-xs-12 col-sm-8">
							<label class="radio radio-success radio-inline">
								<input type="radio" name="data[qrshow]" value="0" {if intval($data['qrshow']) == 0}checked="checked"{/if}>否
							</label>
							<label class="radio radio-success radio-inline">
								<input type="radio" name="data[qrshow]" value="1" {if intval($data['qrshow']) == 1}checked="checked"{/if}>是
							</label>
							<span class="help-block">仅限扫描推广会员海报进入显示</span>
						</div>
					</div>
					{/if}
				</div>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label"></label>
			<div class="col-sm-9">
				<input type="hidden" name="id" value="{$data['id']}" />
				<input type="hidden" name="postType" value="{$_GPC['postType']}" />
				<input type="submit" name="submit" value="提交" class="btn btn-primary min-width" />
				<input type="hidden" name="token" value="{$_W['token']}" />
			</div>
		</div>
		</from>
	</div>
</div>
<script>
	function distri(flag){
		if (flag == 1) {
			$('#distridiv').show();
		} else{
			$('#distridiv').hide();
		}
	}
</script>
{php include wl_template('common/footer');}